<%--
The Community Project
Copyright Team1 Productions

Joshua Amick
Stephen Cunningham
Thema Davis
Tomika Dawson
Lucie DeCristifaro

This JSP is an implementation of the user interface for the Community Project.  Several
tag libraries and custom libraries are used.

All Rights reserved.
--%>

<%@ page %>
<%@ page contentType="text/html"%>
<%@ page pageEncoding="UTF-8"%>

<%-- jstl taglibs --%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%-- struts taglibs --%>
<%@ taglib prefix="html" uri="http://struts.apache.org/tags-html" %>
<%-- custom taglib by Josh --%>
<%@ taglib prefix="custom" tagdir="/WEB-INF/tags/custom" %>

<c:set var="basePath">
	${pageContext.request.scheme}://${pageContext.request.serverName}:${pageContext.request.serverPort}${pageContext.request.contextPath}
</c:set>
<c:set var="servletPath">
	${pageContext.request.servletPath}
</c:set>

<base href="${basePath}/" />


<%-- page content --%>
<custom:frame>
	<page:title title="Submit Announcement or Event"/>	
	<html:form action="/SaveEmailRequest" method="post">
	
	<c:choose>
		<c:when test="${PERMISSIONS == 'admin'}">
			<div id="styleTitle">	
				Send Group Email
			</div>
			</br>
		</c:when>
		<c:otherwise>
			<div id="styleTitle">	
				Request A Group Email
			</div>
			</br>
		</c:otherwise>
	</c:choose>
		<div id="styleInfo">
			<c:if test="${not empty INFO}">
				${INFO}</br>
			</c:if>
		</div>
		<div id="styleErrors">
			<c:if test="${ERROR}">
				${ERROR}</br>
			</c:if>
		</div>
		Subject&nbsp;<html:text property="subject" value="${FORM.subject}"/></br>
		<!--Public or Admin Only?		
		</br>
		<html:radio property="toAll" value="Public"/>Public users&nbsp;&nbsp;
		<html:radio property="toAll" value="Admin"/>Admin
		</br>-->
		Body</br><html:textarea property="body" rows="8" cols="28" value="${FORM.body}"/></br>
		*Note these are plain text emails only.</br>
		Reply Address&nbsp;<html:text property="replyToAddress" value="${FORM.replyToAddress}"/></br>
		<html:submit value="&nbsp;Submit&nbsp;"/>
	</html:form>
</custom:frame>	